package com.anduinslegacy.armory;

import java.util.Comparator;

class PointsComparator implements Comparator<Object>
{
  public int compare(Object obj1, Object obj2)
  {
    int result = 0;
    int num1, num2;
 
    String[] str1 = (String[]) obj1;
    String[] str2 = (String[]) obj2;
    
    num1 = Integer.parseInt(str1[0]);
    num2 = Integer.parseInt(str2[0]);
    
    if (num1 > num2) 
    {    
      result = 1;
    } 
    
    if (num1 < num2) 
    {
    	result = -1;
    }
    
    return result;   
  }
}

/* compareTo:
 * Returns: the value 0 if the argument is a string lexicographically equal to this string; 
 * 			a value less than 0 if the argument is a string lexicographically greater than this string; 
 * 			and a value greater than 0 if the argument is a string lexicographically less than this string.
 */